#pragma once
#include "Control.h"
#include <vector>

namespace Spore
{
	class List : public Control
	{
	public:
		List(const char* name,const char* lable,Control* pParent = NULL,int x = 5,int y = 5,int width = 15,int height = 15);
		virtual ~List(void);

		virtual void OnPaint();

		virtual void OnMouse(int button, int state,int x,int y);

		virtual bool Hover_Detect(int x,int y);

		void  AddItem(const char* item);

		int   GetSelectIndex();
		char* GetItem(int index);

	protected:
		void draw_area(int x, int y, int w, int h);
		void draw_items();

	private:
		Control* m_pParent;
		char*    m_strName;
		char*    m_strLable;
		int      m_iPosX;
		int      m_iPosY;
		int      m_iWidth;
		int      m_iHeight;
		std::vector<const char*> m_Items;
		int      m_SelectIndex;
	};
}